Home:ALL Converter>Why is Javascript returning [object Object]?

Why is Javascript returning [object Object]?

Ask Time:2013-09-02T05:42:05         Author:John Smith

Json Formatter

<script type="text/javascript">
  $("#sign_up").on('click', function() {
    $.post('./includes/ajax.php', { action: 'register' } , function(result) {
      var result = JSON.parse(result);
        if(result ) { $("#register_result") = result; document.write(result); }
    });
  });
$("#register_form").submit(function() {
  return false;
});
</script>

In the console it's returning "All inputs must be entered" - which is what I want it to return.

However, the alert is returning [object Object]. Why is this?

Author:John Smith,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/18563244/why-is-javascript-returning-object-object
Quentin :

console.log will give you a debugging view of an object.\n\nalert will give you a string view of an object.\n\nObjects are converted to strings by calling .toString() on them.\n\nThe default toString() function on a basic object will return \"[Object object]\"",
2013-09-01T21:44:38
yy